#include<iostream>
#include<vector>
using namespace std;

//OJ: 用队列实现栈
namespace code
{
    template<class T, class Container = vector<T>>
    class Stack
    {
    public:
        Stack() {}
        size_t size(){return s.size();}
        bool empty() {return s.empty();}
        void push(const T& x = T()) {s.push_back(x);}
        void pop(){return s.pop_back();}
        T& top() {return s.back();}
        const T& top() const{return s.back();}
        
    private:
        Container s;
    };
}
//OJ测试: 用队实现栈
// T pop() {T ret; return (ret = s.back(),s.pop_back(),ret);}   